<?php
/*
if (!defined('CMS_SYSTEM')) header("Location: index.php");

if(file_exists("data/config_news.php")) require("data/config_news.php");

$content ="";

global $path_upload, $mod_name, $id, $Default_Temp;

if($mod_name == "news" && isset($id)) {
	$seld = "AND id!='$id'";
} else {
	$seld ="";
}
$bl_arr = array();
$bl_arr[] = $bl_l;
$bl_arr[] = $bl_r;
$basename = pathinfo(__FILE__, PATHINFO_BASENAME);
$correctArr = array();
for ($i = 0; $i < count($bl_arr); $i++) {
	for ($h = 0; $h < count($bl_arr[$i]); $h++) {
		$temp = explode("@", $bl_arr[$i][$h]);
		if (($temp[5] == $currentlang) && ($temp[6] == $basename)) {
			$correctArr = $temp;
			break;
		}
	}
}
$result_lastnew = $db->sql_query("SELECT id, title, images, time, hometext FROM ".$prefix."_news WHERE active='1' AND nstart='1' AND alanguage='$currentlang' $seld ORDER BY time DESC LIMIT $perpage");
$numrows = $db->sql_numrows($result_lastnew);
if($numrows > 0) {
	$a=0;
	$content .= "<table border=\"0\" width=\"100%\" cellpadding=\"0\" style=\"background:#ffffff url(templates/$Default_Temp/images/bg_title.gif)  no-repeat\">";
	$content .= "<tr><td><h4>&nbsp;{$correctArr[1]}</h4><br></td></tr>";
	while(list($idlast, $titlelast, $imageslast, $time, $hometext) = $db->sql_fetchrow($result_lastnew)) {
		$content .= "<tr>";
		$get_path = get_path($time);
		$path_upload_img = "$path_upload/news/$get_path";
		$a++;
		if(file_exists("$path_upload_img/$imageslast") && $imageslast !="") {
			if (file_exists("$path_upload_img/thumb_".$imageslast)) $imageslast = "thumb_".$imageslast."";
			$content .= "<td width=\"50\" valign=\"top\"><a href=\"".url_sid("index.php?f=news&do=detail&id=$idlast")."\"><img border=\"0\" src=\"$path_upload_img/$imageslast\" width=\"50\"></a></td>";
			$content .= "<td valign=\"top\"><a href=\"".url_sid("index.php?f=news&do=detail&id=$idlast")."\" class=\"newsothers\">$titlelast</a></td>";
		} else {
			$content .= "<td colspan=\"2\"><a href=\"".url_sid("index.php?f=news&do=detail&id=$idlast")."\" class=\"newsothers\">$titlelast</a></td>";
		}
		$content .= "</tr>";
		$content .= "<tr><td colspan=\"2\" height=\"4\"></td></tr>";
		if ($a < $numrows) $content .= "<tr><td colspan=\"3\"><hr size=\"1\" style=\"border: 1px dotted #666\"></td></tr>";
	}
	$content .= "</table>";
}*/
?>
<?php
if (!defined('CMS_SYSTEM')) header("Location: index.php");

if(file_exists("data/config_news.php")) require("data/config_news.php");
$bl_arr = array();
$bl_arr[] = $bl_l;
$bl_arr[] = $bl_r;
$basename = pathinfo(__FILE__, PATHINFO_BASENAME);
$correctArr = array();
for ($i = 0; $i < count($bl_arr); $i++) {
	for ($h = 0; $h < count($bl_arr[$i]); $h++) {
		$temp = explode("@", $bl_arr[$i][$h]);
		if (($temp[5] == $currentlang) && ($temp[6] == $basename)) {
			$correctArr = $temp;
			break;
		}
	}
}
$content ="";
global $path_upload, $mod_name, $id, $Default_Temp;
if($mod_name == "news" && isset($id)) {
	$seld = "AND id!='$id'";
} else {
	$seld ="";
}

$content .= "<table width=\"180\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" >\n";
$content .= "	<tr height=\"8\"> \n";
$content .= "		<td width=\"8\"  background=\"templates/$Default_Temp/images/search_01.gif\"></td>\n";
$content .= "		<td background=\"templates/$Default_Temp/images/search_line_top.gif\"  ></td>\n";
$content .= "		<td width=\"8\" background=\"templates/$Default_Temp/images/search_02.gif\" ></td>\n";
$content .= "	</tr>\n";
$content .= "	<tr> \n";
$content .= "		<td width=\"8\"  align=\"center\" background=\"templates/$Default_Temp/images/search_line_left.gif\"></td>\n";
$content .= "		<td   align=\"center\">\n";

$result_lastnew = $db->sql_query("SELECT id, title, images, time, hometext FROM ".$prefix."_news WHERE  active='1' AND nstart='1' AND alanguage='$currentlang' $seld ORDER BY time DESC LIMIT $perpage");
$numrows = $db->sql_numrows($result_lastnew);
if($numrows > 0) {
	$a=0;
$content .= "<div class=\"div-block\">";
$content .= "<div class=\"div-tblock\">{$correctArr[1]}</div>";
$content .= "<marquee width=\"178\" height=\"250\" onmouseover=\"stop()\" onmouseout=\"start()\" scrollDelay=\"60\" direction=\"up\" behavior=\"scroll\" scrollAmount=\"2\">";
	$content .= "<table  align=\"center\" border=\"0\" width=\"100%\" cellpadding=\"2\" style=\"border-collapse: collapse\">";
	while(list($idlast, $titlelast, $imageslast, $time, $hometext) = $db->sql_fetchrow($result_lastnew)) {
		$content .= "<tr>";
		$get_path = get_path($time);
		$path_upload_img = "$path_upload/news/$get_path";
		$a++;
		if(file_exists("$path_upload_img/$imageslast") && $imageslast !="") {
			if (file_exists("$path_upload_img/thumb_".$imageslast)) $imageslast = "thumb_".$imageslast."";
			$content .= "<td valign=\"top\"><a href=\"".url_sid("index.php?f=news&do=detail&id=$idlast")."\"><img border=\"0\" src=\"$path_upload_img/$imageslast\" width=\"150\"></a></td><tr></tr>";
			$content .= "<td valign=\"top\"><a href=\"".url_sid("index.php?f=news&do=detail&id=$idlast")."\" class=\"newsothers\">$titlelast</a></td>";
		} else {
			$content .= "<td colspan=\"2\"><a href=\"".url_sid("index.php?f=news&do=detail&id=$idlast")."\" class=\"newsothers\">$titlelast</a></td>";
		}
		$content .= "</tr>";
		$content .= "<tr><td colspan=\"2\" height=\"4\"></td></tr>";
		if ($a < $numrows) $content .= "<tr><td colspan=\"3\"><hr size=\"1\" style=\"border: 1px dotted #666\"></td></tr>";
	}
	$content .= "</table>";
$content .= "</marquee>";
$content .= "</div>";
}
$content .= "</td>\n";
$content .= "<td width=\"8\"  align=\"center\" background=\"templates/$Default_Temp/images/search_line_right.gif\"></td>\n";
$content .= "	</tr>\n";
$content .= "	<tr height=\"8\"> \n";
$content .= "		<td width=\"8\" background=\"templates/$Default_Temp/images/search_03.gif\"></td>\n";
$content .= "		<td background=\"templates/$Default_Temp/images/search_line_bot.gif\"  ></td>\n";
$content .= "		<td width=\"8\" background=\"templates/$Default_Temp/images/search_04.gif\" ></td>\n";
$content .= "	</tr>\n";
$content .= "</table>\n";
?>